home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Amos
/
AMOSList-0497
/
AMOSLIST
/
000176_amos-request@svcs1.digex.net_Mon Apr 21 09:38:23 1997.msg
< prev
next >
Wrap
Text File
|
1998-06-24
|
4KB
|
86 lines
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id JAA17724
for <mcox@access.digex.net>; Mon, 21 Apr 1997 09:38:22 -0400 (EDT)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id HAA27413
for amos-out; Mon, 21 Apr 1997 07:06:21 -0400 (EDT)
Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id HAA27410
for <amos-list@svcs1.digex.net>; Mon, 21 Apr 1997 07:06:20 -0400 (EDT)
Received: from cpt6.stm.tudelft.nl (cpt6.stm.tudelft.nl [130.161.247.6])
by mail3.access.digex.net (8.8.5/8.8.5) with SMTP id HAA05436
for <amos-list@access.digex.net>; Mon, 21 Apr 1997 07:06:19 -0400 (EDT)
Message-Id: <199704211106.HAA05436@mail3.access.digex.net>
Received: by cpt6.stm.tudelft.nl
(1.38.193.4/16.2) id AA27466; Mon, 21 Apr 1997 13:04:32 +0200
From: "Maarten D. de Jong" <dejong@cpt6.stm.tudelft.nl>
Subject: Re: AMOS and ASM
To: amos-list@access.digex.net
Date: Mon, 21 Apr 97 13:04:32 METDST
In-Reply-To: <861602189.0526764.0@h143.redrose.net>; from "Mush" at Apr 21, 97 2:25 am
Mailer: Elm [revision: 70.85]
Status: RO
X-Status:
>
> Ive managed to get a copy of devPac, and am not sure on how to integrate any
> kind of assembler into AMOS. Someone did explain the basics of Dreg to me,
> but I still dont quite get it.
It's basically very simple. You first need to code something in PC-relative
code. That means that stuff like jsr and jmp are out of the question; in-
structions like 'lea Data, a3' should be coded as 'lea Data(pc), a3'. If
you neglect these requirements you'd better make sure you have your ticket
to India handy. Your code should also be one segment. Finally, Devpac is
not capable of writing out raw code, it always wraps a set of hunks around
your code. You need to remove these hunks manually before you load the code
into AMOS. (It's not hard, if you stick to PC-relative code and 1 code
segment, you just need to remove the first 32 bytes and the last 4 bytes.)
Of course, you can circumvent these problems, but then you need to call
on LoadSeg() to load your code into memory. I have never tried this, but
I see no reason why this should fail.
Lets assume an example:
addq.l #8, d1
rts
This code adds 8 to the register d1. You can Poke the code into memory your-
self, it's just four bytes. I've assumed this is done in bank 10. Next you
program in AMOS:
Dreg(1)=100
Call Start(10)
RESULT=Dreg(1)
which should yield 108 as the answer. I've forgotten whether 'call' is the
right instruction, but you probably get the idea. First you setup d1 to
contain 100, then you call your small program. That simply adds 8 to what-
ever is stored in d1, and then returns. AMOS then reads what is inside
d1 -- 108.
Using this technique, I've written a small program which converts AMOS'
FFP numbers into IEEE-compliant ones; I could then use my FPU from within
AMOS 1.36. It's not easy to do (AMOS Pro solved this problem on a much
better level) but it worked!
> Can someone send me an ASM program, which can be merged into AMOS, and
> explain to me how to use it. I would like to write an ASM version of ZOOM,
> and would be interested in routines which will draw onto the screen, or draw
> to mem for a c2p routine.
There are plenty of asm-c2p routines available on Aminet; if you change
the screen base to point to the memory region where AMOS stores the bitplanes
you're in business. I believe it's Screen Base or Phybase which gives you
the required addresses. There was a special demo on the Amos Classic Compiler
disk illustrating a certain effect programmed with ML. You should take a look
at this.
However, if you are not familiar with assembly language, I'd advise you to
study that first. There is no point in messing with it if you don't know
the limitations and possibilities.
Hope this helps a bit,
Maarten